package beans.consts;

/**
 * 是否
 * @author zhangzc
 */
public enum BooleanEnum {

    Yes(1, "是"),
    No(2, "否"),
    Enable(1, "开启"),
    Disable(2, "关闭");

    public int value;
    public String description;

    private BooleanEnum(int val, String desc) {
        this.value = val;
        this.description = desc;
    }

    public static BooleanEnum get(Integer value) {
        for(BooleanEnum v: values()){
            if (value == v.value) {
                return v;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return description;
    }
}